package wsclients;

import org.apache.commons.validator.CreditCardValidator;
import org.apache.commons.validator.GenericValidator;

public class CreditCardValidation {

    /**
     * @param args
     */
    public static void main(String[] args) {
        CreditCardValidator all = new CreditCardValidator();
        CreditCardValidator visa = new CreditCardValidator(CreditCardValidator.VISA);
        CreditCardValidator master = new CreditCardValidator(CreditCardValidator.MASTERCARD);
        System.out.println(all.isValid("4111111111111111"));
        System.out.println(visa.isValid("4111111111111111"));
        System.out.println(master.isValid("4111111111111111"));
        
        
        System.out.println(GenericValidator.matchRegexp("ab","([a-zA-Z]+\\s{1})+[a-zA-Z]+"));
        System.out.println(GenericValidator.matchRegexp("a b","([a-zA-Z]+\\s{1})+[a-zA-Z]+"));
    }

}
